package DesignPattern.Proxy.Chain;

import DesignPattern.Proxy.Interface.Interceptor;
import DesignPattern.Proxy.Interface.InterceptorJdkProxy;
import DesignPattern.Proxy.JDK.HelloWorld;
import DesignPattern.Proxy.JDK.HelloWorldImpl;

import java.lang.reflect.Method;

/**责任链模式
 * @Author: Jun
 * @Date: 2018/9/28 20:59
 */
public class InterceptorChain{
    public static void main(String[] args) {
        HelloWorld proxy1= (HelloWorld) InterceptorJdkProxy.bind(new HelloWorldImpl(),"DesignPattern.Proxy.Chain.Interceptor1");
        HelloWorld proxy2= (HelloWorld) InterceptorJdkProxy.bind(proxy1,"DesignPattern.Proxy.Chain.Interceptor2");
        HelloWorld proxy3= (HelloWorld) InterceptorJdkProxy.bind(proxy2,"DesignPattern.Proxy.Chain.Interceptor3");
        proxy3.sayHelloWorld();
    }
}
